﻿using Microsoft.AspNetCore.Mvc;
using PowerHub.MES.Common.Utility;
using PowerHub.MES.DTO.Crew.DTO;
using PowerHub.MES.DTO.Crew.QueryDto;
using PowerHub.MES.DTO.Shopfloor.DTO;
using PowerHub.MES.DTO.Shopfloor.QueryDTO;
using PowerHub.MES.Entities.Crew;
using PowerHub.MES.Entities.Shopfloor;
using PowerHub.MES.IServices.ICrew;
using PowerHub.MES.IServices.IShopfloor;
using PowerHub.MES.ReturnEntity;

namespace PowerHub.MES.Controllers.Crew
{
    /// <summary>
    /// 班组设置明细
    /// </summary>
    [ApiController]
    [Route("Api/MES/Crew/[controller]/[action]")]
    public class TeamBillDetialController
    {

        private ICrew_TeamBillDetialServices _Crew_TeamBillDetialServices;

        public TeamBillDetialController(ICrew_TeamBillDetialServices TeamBillDetialServices)
        {
            _Crew_TeamBillDetialServices = TeamBillDetialServices;
        }

        /// <summary>
        /// 获取班组设置明细列表
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        [FunctionDescription("获取班组设置明细列表")]
        public async Task<OperationPageResult<List<Crew_TeamBillDetial>>> GetCrew_TeamBillDetialPageListAsync([FromBody] QueryCrew_TeamBillDetialDTO pageQuery)
        {
            return await _Crew_TeamBillDetialServices.GetCrew_TeamBillDetialPageListAsync(pageQuery);
        }


        /// <summary>
        /// 批量删除班组设置明细
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        [FunctionDescription("批量删除班组设置明细")]
        public async Task<OperationResult<object>> DeletionCrew_TeamBillDetialAsync([FromBody] List<string> Query)
        {
            return await _Crew_TeamBillDetialServices.DeletionCrew_TeamBillDetialAsync(Query);
        }

        /// <summary>
        /// 更新班组设置明细
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        [FunctionDescription("更新班组设置明细")]
        public async Task<OperationResult<object>> UpdateCrew_TeamBillDetialAsync([FromBody] Crew_TeamBillDetialDTO Query)
        {
            return await _Crew_TeamBillDetialServices.UpdateCrew_TeamBillDetialAsync(Query);
        }

        /// <summary>
        /// 添加班组设置明细
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        [FunctionDescription("添加班组设置明细")]
        public async Task<OperationResult<object>> CreateCrew_TeamBillDetialAsync([FromBody] Crew_TeamBillDetialDTO Query)
        {
            return await _Crew_TeamBillDetialServices.CreateCrew_TeamBillDetialAsync(Query);
        }
    }
}
